package com.nanfeng.screenshot.service;

import com.nanfeng.screenshot.enums.ChengduHousingEnum;
import org.springframework.stereotype.Service;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * @ClassName：ScreenshotService
 * @Author: LiuYunZhao
 * @Date: 2025/7/11 9:01
 * @Description: 截图工具服务层
 */
@Service
public interface ScreenshotService {

    /**
     * 保存截图并加压
     * @param list
     * @return
     * @throws IOException
     */
     String saveScreenshotAndZip(List<ChengduHousingEnum> list) throws IOException;

    /**
     * 创建临时目录存放截图
     * @return
     */
    String createTempDirectory();

    /**
     * 对每个URL进行截图
     * @param chengduHousing
     * @param outputDir
     */
    void captureScreenshot(ChengduHousingEnum chengduHousing, String outputDir);

    /**
     * 加压文件
     * @param sourceDir
     * @return
     * @throws IOException
     */
    String createZipFile(String sourceDir) throws IOException ;

    /**
     * 删除临时文件
     * @param directory
     */
    void deleteDirectory(File directory) ;
}    